<template>
  <div class="page">
    <div class="row">
      <div class="num-item">
        <span class="label">大区业绩</span>
        <span class="value">{{ bigPerformance }}</span>
      </div>
      <div class="num-item">
        <span class="label">小区业绩</span>
        <span class="value">{{ smallPerformance }}</span>
      </div>
      <div class="num-item">
        <span class="label">好友数量</span>
        <span class="value">{{ userTeam }}</span>
      </div>
    </div>

    <el-table :data="list" border v-loading="loading">
      <el-table-column label="序号" type="index"></el-table-column>
      <el-table-column label="用户ID" prop="uid"></el-table-column>
      <el-table-column label="用户名" prop="realName"></el-table-column>
      <el-table-column label="用户手机号" prop="phone"></el-table-column>
      <el-table-column label="用户账号" prop="userName"></el-table-column>
      <el-table-column label="好友数量" prop="team"></el-table-column>
    </el-table>
  </div>
</template>
<script>
import { userTeam } from "@/api/ds/user";

export default {
  components: {},
  props: {},
  data() {
    return {
      token: "",
      queryTime: [],

      bigPerformance: 0,
      smallPerformance: 0,
      list: [],
      userTeam: 0,

      loading: false,
    };
  },
  computed: {},
  watch: {},
  created() {
    this.token = this.$route.query.token;
    this.queryTime = this.$route.query.queryTime;

    this.getData();
  },
  methods: {
    async getData() {
      this.loading = true;

      let q = {};
      q = this.addDateRange(q, this.queryTime, "");
      let res = await userTeam(q, { token: this.token });
      console.log(res);

      if (res.code === 200) {
        this.bigPerformance = res.data.bigPerformance;
        this.smallPerformance = res.data.smallPerformance;
        this.userTeam = res.data.userTeam;
        this.list = res.data.list;
      }

      this.loading = false;
    },
  },
  mounted() {},
  beforeCreate() {},
  beforeMount() {},
  beforeUpdate() {},
  updated() {},
  beforeDestroy() {},
  destroyed() {},
  activated() {},
  deactivated() {},
};
</script>
<style lang="scss" scoped>
.page {
  width: 100%;
  min-height: 500px;
  box-sizing: border-box;
  padding: 20px 0 0 20px;

  display: flex;
  flex-flow: column nowrap;
  justify-content: flex-start;
  align-items: flex-start;

  .row {
    width: 100%;
    height: 50px;
    margin: 30px 0;

    display: flex;
    flex-flow: row nowrap;
    justify-content: space-evenly;
    align-items: center;

    .num-item {
      min-width: 100px;
      padding: 0 25px;

      color: #333333;
      border-radius: 10px;
      box-shadow: 0 2px 10px 2px #cccccc;

      display: flex;
      flex-flow: column nowrap;
      justify-content: space-evenly;
      align-items: center;

      .label {
        height: 50px;
        line-height: 50px;
        font-size: 20px;
        font-weight: 600;
      }

      .value {
        font-size: 24px;
        color: #ff0000;
        height: 30px;
        line-height: 30px;
      }
    }
  }
}
</style>
